package com.dhy.replugin

import com.qihoo360.replugin.RePluginClassLoader

class AppShareClass : IShareLibClass {
    private val sharedClassHeader: Array<String> = arrayOf(
        "com.onemise.ureader.commons",
        "com.onemise.ureader.pb"
    )

    override fun loadClass(hostClassLoader: RePluginClassLoader, superLoadClass: (String) -> Class<*>, name: String): Class<*>? {
        val share = sharedClassHeader.find { name.startsWith(it) } != null
        return if (share) hostClassLoader.loadClass(name)
        else null
    }
}